package com.ruoyi.common.enums;

import lombok.Getter;

/**
 * @author : anxinr
 * @date : 2023/2/28 17:16
 */
@Getter
public enum OrderStatusEnum {
    ORDER_WAIT_CONFIRM_ADDRESS("待确认配送地址",1),
    ORDER_WAIT_CONFIRM_SEND("订单待配送",2),
    ORDER_CONFIRM_SEND("订单配送中",3),
    ORDER_SUCCESS("配送完成",4),
    ;
    private String message ;
    private Integer code ;
    OrderStatusEnum(String message , Integer code ){
        this.message = message ;
        this.code = code ;
    }

    public static String getOrderDescribeByCode(Integer code){
        OrderStatusEnum[] values = OrderStatusEnum.values();
        for (OrderStatusEnum value : values) {
            if (value.getCode().equals(code)){
                return value.getMessage() ;
            }
        }
        return "未知" ;
    }
}
